#include <stdio.h>
#include "1_2.h"
int globalBss11;
int globalBss12=0;
int global11=2;
static int globalStatic11;
static int globalStatic12=44;

void add(int ,int); // 声明函数add
void main(int argc,char **argv){
    static int localStatic11;
    static int localStatic12=66;
    add(localStatic11,localStatic12);

    int one =globalBss21;
    int two =globalBss22;
    add(one,two);

    int three=global11;
    int four=global21;
    int result2 = mul(three,four);
    printf("result2=%d",result2);
   
}

void add(int a,int b){
    int result=a+b;
    printf("result=%d\n",result);
}
// gcc -E 1_1.c  -o 1_1.s 预编译
// gcc -E 1_3.c -o 1_3.s 预编译
// gcc -S 1_1.c  -o 1_1.i   编译
// gcc -S 1_3.c   -o 1_3.i  编译
// gcc -g -c 1_1.c 1_3.c  预编译 编译汇编
// gcc -g 1_1.c 1_3.c -o 1  预编译，编译，汇编，链接
// 当重定位后，全局变量或者局部的静态变量，采用的是相对偏移的方式进行重定位，全局的函数采用的是绝对虚拟地址的方式
/*
  401122:       55                      push   %rb
  401123:       48 89 e5                mov    %rsp,%rbp
  401126:       48 83 ec 30             sub    $0x30,%rsp
  40112a:       89 7d dc                mov    %edi,-0x24(%rbp)
  40112d:       48 89 75 d0             mov    %rsi,-0x30(%rbp)
  401131:       8b 15 01 2f 00 00       mov    0x2f01(%rip),%edx        # 404038 <localStatic12.2377>
  401137:       8b 05 13 2f 00 00       mov    0x2f13(%rip),%eax        # 404050 <localStatic11.2376>
  40113d:       89 d6                   mov    %edx,%esi
  40113f:       89 c7                   mov    %eax,%edi
  401141:       e8 5c 00 00 00          callq  4011a2 <add>
  401146:       8b 05 14 2f 00 00       mov    0x2f14(%rip),%eax        # 404060 <globalBss21>
  40114c:       89 45 fc                mov    %eax,-0x4(%rbp)
  40114f:       8b 05 ff 2e 00 00       mov    0x2eff(%rip),%eax        # 404054 <globalBss22>
  401155:       89 45 f8                mov    %eax,-0x8(%rbp)
  401158:       8b 55 f8                mov    -0x8(%rbp),%edx
  40115b:       8b 45 fc                mov    -0x4(%rbp),%eax
  40115e:       89 d6                   mov    %edx,%esi
  401160:       89 c7                   mov    %eax,%edi
  401162:       e8 3b 00 00 00          callq  4011a2 <add>
  401167:       8b 05 c3 2e 00 00       mov    0x2ec3(%rip),%eax        # 404030 <global11>
  40116d:       89 45 f4                mov    %eax,-0xc(%rbp)
  401170:       8b 05 c6 2e 00 00       mov    0x2ec6(%rip),%eax        # 40403c <global21>
  401176:       89 45 f0                mov    %eax,-0x10(%rbp)
  401179:       8b 55 f0                mov    -0x10(%rbp),%edx
  40117c:       8b 45 f4                mov    -0xc(%rbp),%eax
  40117f:       89 d6                   mov    %edx,%esi
  401181:       89 c7                   mov    %eax,%edi
  401183:       e8 4a 00 00 00          callq  4011d2 <mul>
  401188:       89 45 ec                mov    %eax,-0x14(%rbp)
  40118b:       8b 45 ec                mov    -0x14(%rbp),%eax
  40118e:       89 c6                   mov    %eax,%esi
  401190:       bf 04 20 40 00          mov    $0x402004,%edi
  401195:       b8 00 00 00 00          mov    $0x0,%eax
  40119a:       e8 91 fe ff ff          callq  401030 <printf@plt>
  40119f:       90                      nop
  4011a0:       c9                      leaveq 
  4011a1:       c3                      retq   






*/